package com.supsky.service2.service;

import com.supsky.service2.convert.OrderConvert;
import com.supsky.service2.dao.OrderDao;
import com.supsky.service2.entity.Orders;
import com.supsky.serviceapi2.dto.OrderDto;
import com.supsky.serviceapi2.service.IOrderService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service(version = "1.0.0", timeout = 5000)
public class OrderService implements IOrderService {

    @Resource
    private OrderDao orderDao;

    @Transactional(readOnly = false)
    public String saveOrder(OrderDto orderDto){
        Orders order = OrderConvert.INSTANCE.dto2po(orderDto);
        Orders newOrder = orderDao.save(order);
        return "ok";
    }

}
